//
//  fourTableViewCell.m
//  lmq
//
//  Created by 千翼网络科技 on 2017/4/12.
//  Copyright © 2017年 yuanxin. All rights reserved.
//

#import "fourTableViewCell.h"
#import "configddd.h"
#import <Masonry/Masonry.h>

@implementation fourTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:@"fourTableViewCell"]) {
        
        [self initView];
    }
    return self;
}

#pragma mark ---------------- init -----------------

- (void)initView{
    
    self.backgroundColor = getColor(@"ffffff");
    
    _threadView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, scrWidth(), screenScale(8))];
    _threadView.backgroundColor = getColor(@"f4f4f4");
    [self addSubview:_threadView];
    
    _stateLable = [[UILabel alloc]init];
    _stateLable.text = @"交易状态";
    _stateLable.textColor = [UIColor redColor];
    _stateLable.textAlignment = NSTextAlignmentCenter;
    _stateLable.font = get4sFont(13);
    [self addSubview:_stateLable];
    [_stateLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView.mas_bottom).with.offset(0);
        make.left.mas_equalTo(self).with.offset(0);
        make.width.mas_equalTo(screenScale(120));
        make.height.mas_equalTo(screenScale(60));
    }];
    
    _threadView1 = [[UIView alloc]initWithFrame:CGRectMake(0, screenScale(70), scrWidth(), screenScale(1))];
    _threadView1.backgroundColor = getColor(@"c1c1c1");
    [self addSubview:_threadView1];
    
    _threadView2 = [[UIView alloc]initWithFrame:CGRectMake(screenScale(120), screenScale(10), screenScale(1), screenScale(60))];
    _threadView2.backgroundColor = getColor(@"c1c1c1");
    [self addSubview:_threadView2];
    
    _dateLable = [[UILabel alloc]init];
    _dateLable.text = @"2017-04-05 11:23:12";
    _dateLable.textColor = getColor(@"6f6f6f");
    _dateLable.textAlignment = NSTextAlignmentRight;
    _dateLable.font = get4sFont(12);
    [self addSubview:_dateLable];
    [_dateLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView.mas_bottom).with.offset(0);
        make.right.mas_equalTo(self).with.offset(screenScale(-20));
        
        make.height.mas_equalTo(screenScale(60));
    }];
    
    _logoImg = [[UIImageView alloc]init];
    [self addSubview:_logoImg];
    [_logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView1.mas_bottom).with.offset(screenScale(20));
        make.left.mas_equalTo(self).with.offset(screenScale(20));
        make.width.mas_equalTo(screenScale(130));
        make.height.mas_equalTo(screenScale(130));
    }];
    
    _nameTextView = [[UITextView alloc]init];
    _nameTextView.text = @"大米饭大米饭";
    _nameTextView.font = get4sFont(12);
    _nameTextView.contentInset = UIEdgeInsetsMake(screenScale(-15), 0, 0, 0);
    _nameTextView.textColor = getColor(@"242424");
    _nameTextView.editable = NO;
    [self addSubview:_nameTextView];
    [_nameTextView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView1.mas_bottom).with.offset(screenScale(20));
        make.left.mas_equalTo(_logoImg.mas_right).with.offset(screenScale(20));
        make.width.mas_equalTo(screenScale(350));
        make.height.mas_equalTo(screenScale(118));
    }];
    
    _priceLable = [[UILabel alloc]init];
    _priceLable.text = @"0.01";
    _priceLable.textColor = getColor(@"6f6f6f");
    _priceLable.textAlignment = NSTextAlignmentRight;
    _priceLable.font = get4sFont(12);
    [self addSubview:_priceLable];
    [_priceLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView1.mas_bottom).with.offset(screenScale(20));
        make.right.mas_equalTo(self).with.offset(screenScale(-20));
        
        make.height.mas_equalTo(screenScale(26));
    }];
    
    _numLable = [[UILabel alloc]init];
    _numLable.text = @"2";
    _numLable.textColor = getColor(@"6f6f6f");
    _numLable.textAlignment = NSTextAlignmentRight;
    _numLable.font = get4sFont(12);
    [self addSubview:_numLable];
    [_numLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView1.mas_bottom).with.offset(screenScale(66));
        make.right.mas_equalTo(self).with.offset(screenScale(-20));
        
        make.height.mas_equalTo(screenScale(26));
    }];
    
    _threadView3 = [[UIView alloc]init];
    _threadView3.backgroundColor = getColor(@"c1c1c1");
    [self addSubview:_threadView3];
    [_threadView3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView1.mas_bottom).with.offset(screenScale(170));
        make.left.mas_equalTo(self).with.offset(0);
        make.width.mas_equalTo(scrWidth());
        make.height.mas_equalTo(screenScale(1));
    }];
    
    _moneyLable = [[UILabel alloc]init];
    _moneyLable.text = @"总价";
    _moneyLable.textColor = getColor(@"242424");
    _moneyLable.textAlignment = NSTextAlignmentRight;
    _moneyLable.font = get4sFont(14);
    [self addSubview:_moneyLable];
    [_moneyLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView3.mas_bottom).with.offset(0);
        make.right.mas_equalTo(self).with.offset(screenScale(-20));
        
        make.height.mas_equalTo(screenScale(75));
    }];
}

@end
